using MediatR;
using RBAC.ErrorCode;
using System.Collections.Generic;

namespace RBAC.Write.Api.Application.Command.ProcessManagements
{
    /// <summary>
    /// 新增工序（主信息 + 附件）
    /// </summary>
    public class AddProcessCommand : IRequest<APIResult<int>>
    {
        /// <summary>
        /// 工序编号（如：GJ-001）。必填且唯一
        /// </summary>
        public string? ProcessCode { get; set; }

        /// <summary>
        /// 系统编号（页面显示编号，可选）
        /// </summary>
        public string? SystemCode { get; set; }

        /// <summary>
        /// 工序名称。必填且唯一
        /// </summary>
        public string? ProcessName { get; set; }

        /// <summary>
        /// 工序分类Id
        /// </summary>
        public long? ClassificationId { get; set; }

        /// <summary>
        /// 工序分类名称（可冗余）
        /// </summary>
        public string? ClassificationName { get; set; }

        /// <summary>
        /// 所属部门Id
        /// </summary>
        public long? DepartmentId { get; set; }

        /// <summary>
        /// 所属部门名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 负责人用户Id
        /// </summary>
        public long? OwnerUserId { get; set; }

        /// <summary>
        /// 负责人用户名
        /// </summary>
        public string? OwnerUserName { get; set; }

        /// <summary>
        /// 状态（1=启用，0=禁用）
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 附件集合（可选）
        /// </summary>
        public List<ProcessAttachmentInput>? Attachments { get; set; }
    }

    /// <summary>
    /// 新增工序的附件输入
    /// </summary>
    public class ProcessAttachmentInput
    {

        /// <summary>
        /// 文件名
        /// </summary>
        public string? FileName { get; set; }
        /// <summary>
        /// 文件URL
        /// </summary>
        public string? FileUrl { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        public long? FileSize { get; set; }
        /// <summary>
        /// 文件类型
        /// </summary>
        public string? ContentType { get; set; }
        /// <summary>
        /// 文件Hash
        /// </summary>
        public string? FileHash { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
        /// <summary>
        /// 状态（默认 1 有效）
        /// </summary>
        public int Status { get; set; } = 1;
    }
}
